<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Grom Hellscream
 * Date: 10/30/12
 * Time: 7:31 AM
 * To change this template use File | Settings | File Templates.
 */
// No direct access
defined('_JEXEC') or die;

/**
 * Hosocanbo component helper.
 *
 * @package		Joomla.Administrator
 * @subpackage	com_content
 * @since		1.6
 */
class HosocanbosHelper
{
    public static $extension = 'com_vast';

    /**
     * Configure the Linkbar.
     *
     * @param	string	$vName	The name of the active view.
     *
     * @return	void
     * @since	1.6
     */
    public static function addSubmenu($vName)
    {
    }

    /**
     * Gets a list of the actions that can be performed.
     *
     * @param	int		The hosocanbo ID.
     *
     * @return	JObject
     * @since	1.6
     */
    public static function getActions($hosocanboId = 0)
    {
        // Reverted a change for version 2.5.6
        jimport('joomla.access.access');
        $user	= JFactory::getUser();
        $result	= new JObject;

        if (empty($hosocanboId)) {
            $assetName = 'com_vast';
        }
        else {
            $assetName = 'com_vast.hosocanbo.'.(int) $hosocanboId;
        }

        $actions = JAccess::getActions('com_vast', 'component');
        
        foreach ($actions as $action) {
            $result->set($action->name, $user->authorise($action->name, $assetName));
        }

        return $result;
    }

}